﻿using System;

namespace _05_Prototype
{
    class Program
    {
        /// <summary>
        /// 原型模式
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            ExamPaper xm = new ExamPaper();
            xm.MyName = "小明";
            xm.ShowPaper();
            ExamPaper xb = xm.Clone();
            xb.MyName = "小白";
            xb.ShowPaper();

            Console.WriteLine();
            Console.WriteLine(xm.MyName);
            Console.ReadKey();
        }
    }
    class ExamPaper
    {
        //生成考试试卷
        public string MyName { get; set; }
        public ExamPaper()
        {
            //从题库查询100道题
        }
        public void ShowPaper()
        {
            //随机打乱顺序
            Console.WriteLine("考生姓名:" + MyName);
            Console.WriteLine("选择题...");
            Console.WriteLine("填空题...");
            Console.WriteLine("判断题...");
        }
        public ExamPaper Clone()
        {
            return (ExamPaper)this.MemberwiseClone();  //浅复制
        }
    }
}
